import Cookies from 'js-cookie';
import { defineStore } from 'pinia';

const useShareYwgztDataStore = defineStore('ywgztSysShare', {
	state: (): anyObj => ({
		sysShare: {
			labelTimeArr: [],
			completeCountArr: [],
			alarmCountArr: [],
			yesterdayArr: [],
		},
	}),
	actions: {
		addYwgztSysShare(cfg: anyObj) {
			this.sysShare[cfg.arrName] = cfg.data;
			Cookies.set('ywgztSysShare', this.sysShare);
		},
		deleteYwgztSysShare() {
			this.sysShare = {};
			Cookies.set('ywgztSysShare', '');
		},
	},
});

export default useShareYwgztDataStore;
